//
//  SwitchPageView.h
//  Rongcloud
//
//  Created by LiuLinhong on 2017/08/25.
//  Copyright © 2017年 Beijing Rongcloud Network Technology Co. , Ltd. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#define kSwitchPageViewColor [NSColor colorWithRed:9.0/255.0 green:41.0/255.0 blue:64.0/255.0 alpha:0.6]

@class SwitchPageViewControl;


@protocol SwitchPageViewControlDelegate <NSObject>

@optional
- (NSEdgeInsets)switchPageViewControl:(SwitchPageViewControl *_Nonnull)switchPageViewControl insetOfCellAtIndex:(NSIndexPath *_Nonnull)indexPath;

- (void)switchPageViewControl:(SwitchPageViewControl *_Nonnull)switchPageViewControl didSelectedCellAtIndexPath:(NSIndexPath *_Nonnull)indexPath;

@end


@protocol SwitchPageViewControlDateSource <NSObject>

@required
- (NSInteger)switchPageViewControl:(SwitchPageViewControl *_Nonnull)switchPageViewControl numberOfCellsInSwitchPageView:(NSInteger)pageIndex;

- (NSDictionary *_Nonnull)switchPageViewControl:(SwitchPageViewControl *_Nonnull)switchPageViewControl cellViewForIndex:(NSIndexPath *_Nonnull)indexPath;

@optional
- (NSInteger)numberOfPagesInSwitchPageViewControl:(SwitchPageViewControl *_Nonnull)switchPageViewControl;

@end


@interface SwitchPageViewControl : NSObject

@property (nonatomic, weak, nullable) id <SwitchPageViewControlDelegate> delegate;
@property (nonatomic, weak, nullable) id <SwitchPageViewControlDateSource> dataSource;
@property (nonatomic, strong) NSMutableArray * _Nonnull remoteVideoCellArray;
@property (nonatomic, strong) NSMutableArray * _Nonnull remoteWindowArray;
@property (nonatomic, assign) NSInteger cellNumberInFullPage;
@property (nonatomic, strong) NSMutableDictionary * _Nonnull cellDic, * _Nonnull windowDic;

- (instancetype _Nonnull )initWithViewBuilder:(NSViewController *_Nullable)vc;

- (void)reloadCellInPageView;
- (void)loadCellVideoView:(NSIndexPath *_Nonnull)indexPath withUserID:(NSString *_Nonnull)userID;
- (void)addNewCellView:(NSIndexPath *_Nonnull)indexPath;
- (void)removeCellView:(NSIndexPath *_Nonnull)indexPath;
- (void)moveLeftSwitchPage;
- (void)moveRightSwitchPage;
- (void)switchPageCellPressed:(NSIndexPath *_Nonnull)indexPath;

@end
